﻿using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Mask : MonoBehaviour
{
    // Start is called before the first frame update
    public MaskType type;
    public SpriteRenderer sr;
    void Start()
    {
        sr = GetComponent<SpriteRenderer>();
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void init()
    {
        type = MaskType.FULL;
        changeSprite(type);
    }

    public void change(int maskCode)
    {
        int temp= Convert.ToInt32(type);
        type = (MaskType)(temp | maskCode);
        changeSprite(type);
    }

    public void changeSprite(MaskType mt)
    {
        sr.sprite = MaskManager.Instance.texture[(int)mt];
    }
}
